<template>
  <div>
    <div>
      <img :src="shopDscb.logo">
      <span>{{shopDscb.name}}</span>
    </div>
    <div class="middle-all">

      <div class="middle-left">
        <div>
          <p>{{shopDscb.sells|sellFilter}}</p>
          <P>总销量</P>
        </div>
        <div>
          <p>{{shopDscb.goodsCount}}</p>
          <P>全部宝贝</P>
        </div>
      </div>

      <div class="middle-right">
        <table>
          <tr v-for="(item,index) in shopDscb.score" :key="index">
            <td>{{item.name}}</td>
            <td>{{item.score}}</td>
            <td class="better" :class="{'better-more':item.isBetter}">{{item.isBetter?'高':'低'}}</td>
          </tr>
        </table>
      </div>

    </div>

    <div class="shop-bottom">
      <div class="enter-shop">进店逛逛</div>
    </div>

  </div>
</template>

<script>
  export default {
    name: "ShopDescribe",
    props: {
      shopDscb:{
        type:Object,
        default(){return {}}
      }
    },
    filters:{
      sellFilter(nums){
        if(nums<10000){return nums}
        else {
          return (nums/10000).toFixed(1)+'万'
        }
      }
    }
  }
</script>

<style scoped>
  .shop-bottom{
    margin-top: 20px;
    width: 100%;
    text-align: center;
  }
  .enter-shop{
    padding: 7px;
    font-size: 15px;
    display: inline-block;
    width: 120px;
    background-color: rgba(100,100,100,0.1);
    border-radius: 10px;
  }
  .better{
    background-color: #5ea732;
    color: #fff;
  }
  .better-more{
    background-color: #ff5777;
  }
  img{
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
    position: relative;
    top: 16px;
    left: 5px;
    margin-right: 10px;
  }
  .middle-all{
    width: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 12px;
    text-align: center;
    align-items: center;
  }
  .middle-left{
    width: 50%;
    display: flex;
    justify-content: space-evenly;
    border-right: rgba(100,100,100,0.3) 1px solid;
  }
  .middle-left p{
    margin-top: 5px;
  }
  .middle-right{
    display: flex;
    width: 50%;
    justify-content: space-evenly;
  }
  td{
    padding: 5px;
  }
</style>